Tryit Editor v2.3

Edit This Code:
<!DOCTYPE html> <html> <body> <p>Click the button to create an OBJECT and a PARAM element with an embedded audio file.</p> <button onclick="myFunction()">Try it</button> <script> function myFunction() { var x = document.createElement("OBJECT"); x.setAttribute("data", "horse.wav"); x.setAttribute("id", "myObject"); document.body.appendChild(x); var y = document.createElement("PARAM"); y.setAttribute("name", "autoplay"); y.setAttribute("value", "true"); document.getElementById("myObject").appendChild(y); } </script> </body> <!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_param_create by HTTrack Website Copier/3.x [XR&CO'2014], Fri, 23 Jan 2015 08:04:55 GMT --> </html>
Result:
Try it Yourself - © w3schools.com